Safe Deployments
This contract contains a collection of deployments of the contract of the Safe contracts repository.
The addresses on the different networks and the abi files are available for each deployment. To get an overview of the available versions, check the available json assets.
Adding additional deployments:
- Follow the deployment steps in the Safe contract repository.
- Verify that the addresses match the expected address for each contract. You can find them under the "addresses" mapping in the respective JSON file in the assets folder.
- Create a PR adding the new deployment. Example PR can be found here.
Deployments overview
ContractScan is a 3rd party tool that is not maintained by the Safe team
Install
- npm -
npm i @safe-global/safe-deployments
- yarn -
yarn add @safe-global/safe-deployments
Usage
It is possible to directly use the JSON files in the assets folder that contain the addresses and ABI definitions.
An alternative is using JavaScript library methods to query the correct deployment. The library supports different methods to get the deployment of a specific contract.
Each of the methods takes an optional DeploymentFilter
as a parameter.
interface DeploymentFilter {
version?: string;
released?: boolean;
network?: string;
}
V1 Methods (single deployments)
Those methods will return a SingletonDeployment
object or undefined
if no deployment was found for the specified filter.
export interface SingletonDeployment {
defaultAddress: string;
released: boolean;
contractName: string;
version: string;
deployments: Record<string, { address: string; codeHash: string }>;
networkAddresses: Record<string, string>;
abi: any[];
}
const safeSingleton = getSafeSingletonDeployment();
const safeSingletonNightly = getSafeSingletonDeployment({ released: undefined });
const safeSingletonGörli = getSafeSingletonDeployment({ network: '5' });
const safeSingleton100 = getSafeSingletonDeployment({ version: '1.0.0' });
const safeL2Singleton = getSafeL2SingletonDeployment();
const proxyFactory = getProxyFactoryDeployment();
const multiSendLib = getMultiSendDeployment();
const multiSendCallOnlyLib = getMultiSendCallOnlyDeployment();
const createCallLib = getCreateCallDeployment();
const signMessageLib = getSignMessageLibDeployment();
const callbackHandler = getDefaultCallbackHandlerDeployment();
const compatHandler = getCompatibilityFallbackHandlerDeployment();
V2 Methods (multiple deployments)
We added a new methods that allow multiple deployment addresses for a contract.
Those methods will return a SingletonDeployment
object or undefined
if no deployment was found for the specified filter. Notice the difference in the networkAddresses
field.
export interface SingletonDeployment {
defaultAddress: string;
released: boolean;
contractName: string;
version: string;
deployments: Record<string, { address: string; codeHash: string }>;
networkAddresses: Record<string, string | string[]>;
abi: any[];
}
const safeSingleton = getSafeSingletonDeployments();
const safeSingletonNightly = getSafeSingletonDeployments({ released: undefined });
const safeSingletonGörli = getSafeSingletonDeployments({ network: '5' });
const safeSingleton100 = getSafeSingletonDeployments({ version: '1.0.0' });
const safeL2Singleton = getSafeL2SingletonDeployments();
const proxyFactory = getProxyFactoryDeployments();
const multiSendLib = getMultiSendDeployments();
const multiSendCallOnlyLib = getMultiSendCallOnlyDeployments();
const createCallLib = getCreateCallDeployments();
const signMessageLib = getSignMessageLibDeployments();
const callbackHandler = getDefaultCallbackHandlerDeployments();
const compatHandler = getCompatibilityFallbackHandlerDeployments();
Release cycle
safe-deployments
release cycle is once per month, except for urgent issues that require immediate attention.
Notes
-
v1 supports only one address per network, while v2 allows multiple addresses per network. To maintain compatibility with v1, the address order in v2 is arranged so that the first address matches the one used in v1.
-
A list of network information can be found at chainid.network
License
This library is released under MIT.